<div class="main_body">
    <?php echo $this->element('main_menu')?>			
	<div id="main_body_content">
		
		<div class="customers view">
			<h1><?php  __('Customer');?></h1>
			<dl><?php $i = 0; $class = ' class="altrow"';?>

				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['name']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Surname'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['surname']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Address1'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['address1']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Address2'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['address2']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Address3'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['address3']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Address4'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['address4']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Phone1'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['phone1']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Phone2'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['phone2']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Phone3'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['phone3']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Phone4'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['phone4']; ?>
					&nbsp;
				</dd>

				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Registration Date'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['registration_date']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Note'); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $customer['Customer']['note']; ?>
					&nbsp;
				</dd>
			</dl>
		</div>
		<div class="clr"></div>	
		
		<?php if (!empty($customer['Order'])):?>
		<div class="index related">
			<h1><?php __('Related Orders');?></h1>
		
			<table cellpadding = "0" cellspacing = "0">
			<tr>
				<th><?php __('Numer'); ?></th>
				<th><?php __('Service'); ?><br/>
					<?php __('Spaces'); ?></th>
				<th><?php __('Status'); ?></th>
				<th><?php __('Time [h]'); ?><br/>
					<?php __('Value'); ?></th>
				
				<th class="actions"><?php __('Actions');?></th>
			</tr>
			<?php
				$i = 0;
				foreach ($customer['Order'] as $order):
					$class = null;
					if ($i++ % 2 == 0) {
						$class = ' class="altrow"';
					}
				?>
				<tr<?php echo $class;?>>
					<td><?php echo $order['numer'];?></td>
					<td><?php echo $typeOfServices[$order['type_of_service_id']];?><br/>
						<?php echo $typesOfSpaces[$order['types_of_spaces_id']];?></td>
					<td><?php echo $statusOfImplementation[$order['status_of_implementation']];?><br/>
						<?php echo $paymentStatus[$order['payment_status']];?></td>
					<td><?php echo $order['estimated_execution_time'];?><br/>
						<?php echo $order['value_of_the_order'];?></td>
					
					<td class="actions">
						<?php echo $this->Html->link($html->image(HOST.'/actions_16_view.png'), array('controller' => 'orders', 'action' => 'view', $order['id']),array('title'=>__('View', true),'escape'=>false)); ?>
						<?php echo $this->Html->link($html->image(HOST.'/actions_16_edit.png'), array('controller' => 'orders', 'action' => 'edit', $order['id']),array('title'=>__('Edit', true),'escape'=>false)); ?>
						<?php echo $this->Html->link($html->image(HOST.'/actions_16_delete.png'), array('controller' => 'orders', 'action' => 'delete', $order['id']), array('title'=>__('Delete', true),'escape'=>false), sprintf(__('Are you sure you want to delete # %s?', true), $order['id'])); ?>
					</td>
				</tr>
			<?php endforeach; ?>
			</table>
		
		</div>
		<div class="clr"></div>	
		<?php endif; ?>		
	</div>	
		
	<?php echo $this->element('languages')?>	
	<div class="clr"></div>


</div>	
<div class="clr"></div>	
<div class="main_action">
	<div class="main_action_content">	
	
		<div class="actions">
			<h3><?php __('Actions'); ?></h3>
			<ul>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_customer_edit.png'), array('action' => 'edit', $customer['Customer']['id']),array('escape'=>false,'title'=>__('Edit Customer', true))); ?><div class="clr"></div>	<?php echo __('Edit Customer', true)?> </li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_customer_delete.png'), array('action' => 'delete', $customer['Customer']['id']), array('escape'=>false,'title'=>__('Delete Customer', true)), sprintf(__('Are you sure you want to delete # %s?', true), $customer['Customer']['id'])); ?><div class="clr"></div>	<?php echo __('Delete Customer', true)?> </li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_customers.png'), array('action' => 'index'),array('escape'=>false,'title'=>__("List Customers",true)));?><div class="clr"></div>	<?php echo __("List Customers",true)?></li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_customer_add.png'), array('action' => 'add'),array('escape'=>false,'title'=>__('New Customer', true))); ?> <div class="clr"></div>	<?php echo __('New Customer', true)?></li>			
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_orders_list.png'), array('controller' => 'orders', 'action' => 'index'),array('escape'=>false,'title'=>__('List Orders', true))); ?><div class="clr"></div>	<?php echo __('List Orders', true)?> </li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_orders_add.png'), array('controller' => 'orders', 'action' => 'add'),array('escape'=>false,'title'=>__('New Order', true))); ?><div class="clr"></div>	 <?php echo __('New Order', true)?> </li>
			</ul>
		</div>
		<div class="clr"></div>
	</div>		
</div>

